# name : proc rmstreg from restricted mean survival time
# key : rmstreg.
# contributor: Shuguang Sun
# --
ods select ModelInfo LSMeans Diffs;
proc rmstreg data=${1:dtin} tau=${2:48};
class ${3:trt01p} (ref='');
model ${4:aval} * ${5:cnsr} (0) = $3 $0 / link=${6:$$(yas-choose-value '("linear" "log"))} method=${7:$$(yas-choose-value '("pv" "ipcw" "ipcw(strata=trt01p)"))};
lsmeans $3 / pdiff;
run;